mirror of
https://github.com/octoleo/syncthing.git
synced 2024-12-23 03:18:59 +00:00
cmd/syncthing: Check os.Args length (fixes #7486)
This commit is contained in:
parent
cd21b8dfa5
commit
39c2d1bc1a
@ -215,7 +215,7 @@ func main() {
|
|||||||
// The "cli" subcommand uses a different command line parser, and e.g. help
|
// The "cli" subcommand uses a different command line parser, and e.g. help
|
||||||
// gets mangled when integrating it as a subcommand -> detect it here at the
|
// gets mangled when integrating it as a subcommand -> detect it here at the
|
||||||
// beginning.
|
// beginning.
|
||||||
if os.Args[1] == "cli" {
|
if len(os.Args) > 1 && os.Args[1] == "cli" {
|
||||||
if err := cli.Run(); err != nil {
|
if err := cli.Run(); err != nil {
|
||||||
fmt.Println(err)
|
fmt.Println(err)
|
||||||
os.Exit(1)
|
os.Exit(1)
|
||||||
|
Loading…
Reference in New Issue
Block a user