sapling/eden/fs/cli/trace.py
Ratnadeep Joshi 136b03fb92 Changing eden/Eden/edenfs/Edenfs in the help and other user visible texts to EdenFS
Summary: There are a lot of places in user visible text such as command line help  where EdenFS is mentioned as eden/Eden/edenfs/EdenFS. This will make it consistent to 'EdenFS' in most cases. In the places where it is referring to the process/daemon, 'edenfs' will be used.

Reviewed By: chadaustin

Differential Revision: D29419151

fbshipit-source-id: 7b8296f0a0c84fdcb566ff811f7fcedbe7079189
2021-07-06 12:17:20 -07:00

44 lines
1.3 KiB
Python

#!/usr/bin/env python3
# Copyright (c) Facebook, Inc. and its affiliates.
#
# This software may be used and distributed according to the terms of the
# GNU General Public License version 2.
import argparse
from . import cmd_util, subcmd as subcmd_mod
from .subcmd import Subcmd
from .trace_cmd import trace_cmd
@trace_cmd("enable", "Enable tracing")
class EnableTraceCmd(Subcmd):
def run(self, args: argparse.Namespace) -> int:
instance = cmd_util.get_eden_instance(args)
with instance.get_thrift_client_legacy() as client:
client.enableTracing()
return 0
@trace_cmd("disable", "Disable tracing")
class DisableTraceCmd(Subcmd):
def run(self, args: argparse.Namespace) -> int:
instance = cmd_util.get_eden_instance(args)
with instance.get_thrift_client_legacy() as client:
client.disableTracing()
return 0
@subcmd_mod.subcmd("trace", "Commands for managing EdenFS tracing")
# pyre-fixme[13]: Attribute `parser` is never initialized.
class TraceCmd(Subcmd):
parser: argparse.ArgumentParser
def setup_parser(self, parser: argparse.ArgumentParser) -> None:
self.parser = parser
self.add_subcommands(parser, trace_cmd.commands)
def run(self, args: argparse.Namespace) -> int:
self.parser.print_help()
return 0