[cli] Delete --root flag
It's been replaced by the -C flag, and can be removed entirely after all
downstream usages have been fixed.
Change-Id: Id3e98914e5dceb65a5715e8102b05451c0fa2aa5
Reviewed-on: https://fuchsia-review.googlesource.com/c/shac-project/shac/+/914338
Reviewed-by: Anthony Fandrianto <atyfto@google.com>
Fuchsia-Auto-Submit: Oliver Newman <olivernewman@google.com>
Commit-Queue: Auto-Submit <auto-submit@fuchsia-infra.iam.gserviceaccount.com>
diff --git a/internal/cli/base.go b/internal/cli/base.go
index 97f7e5a..716216b 100644
--- a/internal/cli/base.go
+++ b/internal/cli/base.go
@@ -22,7 +22,6 @@
)
type commandBase struct {
- root string
cwd string
allFiles bool
noRecurse bool
@@ -35,27 +34,14 @@
f.BoolVar(&c.noRecurse, "no-recurse", false, "do not look for shac.star files recursively")
c.vars = stringMapFlag{}
f.Var(&c.vars, "var", "runtime variables to set, of the form key=value")
-
- // TODO(olivernewman): Delete this flag after it's no longer used.
- f.StringVar(&c.root, "root", ".", "path to the root of the tree to analyse")
- // MarkHidden instead of MarkDeprecated to prevent warnings from being
- // emitted.
- f.MarkHidden("root")
}
func (c *commandBase) options(files []string) (engine.Options, error) {
if c.allFiles && len(files) > 0 {
return engine.Options{}, errors.New("--all cannot be set together with positional file arguments")
}
- cwd := c.cwd
- if c.root != "." {
- if cwd != "." {
- return engine.Options{}, errors.New("--root and --cwd cannot both be set")
- }
- cwd = c.root
- }
return engine.Options{
- Dir: cwd,
+ Dir: c.cwd,
AllFiles: c.allFiles,
Files: files,
Recurse: !c.noRecurse,