MCPcopy Create free account
hub / github.com/ceph/ceph / parse_cli

Function parse_cli

src/python-common/ceph/smb/ctl/__main__.py:500–557  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

498
499
500def parse_cli() -> argparse.Namespace:
501 parser = argparse.ArgumentParser()
502 vg = parser.add_mutually_exclusive_group()
503 vg.add_argument(
504 '--verbose', '-v', action='store_true', help='Enable verbose logging'
505 )
506 vg.add_argument(
507 '--quiet', '-q', action='store_true', help='Enable minimal output'
508 )
509 g1 = parser.add_argument_group('Server Selection')
510 mg = g1.add_mutually_exclusive_group()
511 mg.add_argument(
512 '--address',
513 type=str,
514 help='Location of gRPC server - <host_or_addr>:<port> for TCP servers',
515 )
516 mg.add_argument(
517 '--cluster',
518 '-c',
519 type=ClusterInfo,
520 help=(
521 'Ceph SMB cluster selector.'
522 ' Format [<FSID>/][smb.]<service-prefix>.'
523 ' Choose the SMB service (aka SMB cluster) to connect to'
524 ' using an optional Ceph FSID and SMB service.'
525 ' Example: 45d9b47e-47f0-11f1-906a-525400220000/smb.cluster1'
526 ),
527 )
528 g2 = parser.add_argument_group('TLS Credentials')
529 g2.add_argument(
530 '--tls-cert',
531 type=TLSPath.create,
532 help='Path to TLS certificate',
533 )
534 g2.add_argument(
535 '--tls-key',
536 type=TLSPath.create,
537 help='Path to TLS Key',
538 )
539 g2.add_argument(
540 '--tls-ca-cert',
541 type=TLSPath.create,
542 help='Path to TLS CA certificate',
543 )
544 parser.add_argument(
545 '--no-tls',
546 action='store_true',
547 help='Do not use TLS when connecting to remote server',
548 )
549 parser.add_argument(
550 '--header',
551 dest='grpc_headers',
552 type=_header,
553 action='append',
554 help='Add gRPC header to call. Takes the form <KEY>=<VALUE>',
555 )
556 commands._configure(parser.add_subparsers(required=True), [])
557 return parser.parse_args()

Callers 1

mainFunction · 0.70

Calls 3

add_argumentMethod · 0.45
_configureMethod · 0.45
parse_argsMethod · 0.45

Tested by

no test coverage detected