MCPcopy Create free account
hub / github.com/Facets-cloud/flow / cmdWorkdir

Function cmdWorkdir

internal/app/workdir.go:18–37  ·  view source on GitHub ↗

cmdWorkdir dispatches `flow workdir list|add|remove|scan`.

(args []string)

Source from the content-addressed store, hash-verified

16
17// cmdWorkdir dispatches `flow workdir list|add|remove|scan`.
18func cmdWorkdir(args []string) int {
19 if len(args) == 0 {
20 fmt.Fprintln(os.Stderr, "error: workdir requires a subcommand (list|add|remove|scan)")
21 return 2
22 }
23 sub, rest := args[0], args[1:]
24 switch sub {
25 case "list":
26 return cmdWorkdirList(rest)
27 case "add":
28 return cmdWorkdirAdd(rest)
29 case "remove", "rm":
30 return cmdWorkdirRemove(rest)
31 case "scan":
32 return cmdWorkdirScan(rest)
33 default:
34 fmt.Fprintf(os.Stderr, "error: unknown workdir subcommand %q\n", sub)
35 return 2
36 }
37}
38
39// openFlowDBForWorkdir opens the flow DB and returns (db, rc). On error, it
40// prints and returns a non-nil error rc.

Callers 10

TestE2EFullRoundtripFunction · 0.85
RunFunction · 0.85
TestCmdWorkdirListFunction · 0.85
TestCmdWorkdirRemoveFunction · 0.85
TestCmdWorkdirScanNoAddFunction · 0.85
TestCmdWorkdirScanAddFunction · 0.85

Calls 4

cmdWorkdirListFunction · 0.85
cmdWorkdirAddFunction · 0.85
cmdWorkdirRemoveFunction · 0.85
cmdWorkdirScanFunction · 0.85

Tested by 9

TestE2EFullRoundtripFunction · 0.68
TestCmdWorkdirListFunction · 0.68
TestCmdWorkdirRemoveFunction · 0.68
TestCmdWorkdirScanNoAddFunction · 0.68
TestCmdWorkdirScanAddFunction · 0.68