Skip to content

Commit 27ecb2c

Browse files
committed
Fix comments for SeparateArguments and ExtractCvdArgs
Bug: b/389804379 Test: /usr/bin/bazel run :cvd -- --instance_name=1 status
1 parent 0778a89 commit 27ecb2c

File tree

2 files changed

+1
-28
lines changed

2 files changed

+1
-28
lines changed

base/cvd/cuttlefish/host/commands/cvd/cli/frontline_parser.cpp

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,6 @@ namespace cuttlefish {
3434
using selector::SeparateArguments;
3535
using selector::SeparatedArguments;
3636

37-
/* the very first command line parser
38-
*
39-
* Being aware of valid subcommands and cvd-specific commands, it will
40-
* separate the command line arguments into:
41-
*
42-
* 1. program path/name
43-
* 2. cvd-specific arguments
44-
* a) selector flags
45-
* b) non-selector flags
46-
* 3. subcommand
47-
* 4. subcommand arguments
48-
*/
4937
Result<cvd_common::Args> ExtractCvdArgs(cvd_common::Args& args) {
5038
CF_EXPECT(!args.empty());
5139

base/cvd/cuttlefish/host/commands/cvd/cli/selector/arguments_separator.h

Lines changed: 1 addition & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -49,23 +49,8 @@ struct SeparatedArguments {
4949
* $ program_path/name <optional cvd-specific flags> \
5050
* subcmd <optional subcmd arguments>
5151
*
52-
* For the parser's sake, there are a few more rules.
52+
* For the parser's sake, there are is another rule.
5353
*
54-
* 1. All the optional cvd-specific flags should be pre-registered. Usually,
55-
* the subcmd arguments do not have to be registered. However, cvd-specific
56-
* flags must be.
57-
*
58-
* E.g. "--clean" is the only registered cvd-specific flag, which happened
59-
* to be bool.
60-
* These are okay:
61-
* cvd --clean start --never-exist-flag
62-
* cvd --noclean stop
63-
* cvd start
64-
*
65-
* However, this is not okay:
66-
* cvd --daemon start
67-
*
68-
* 2. --
6954
* E.g. cvd --clean start --have --some --args -- a b c d e
7055
* -- is basically for subcommands. cvd itself does not use it.
7156
* If -- is within cvd arguments, it is ill-formatted. If it is within

0 commit comments

Comments
 (0)