1 // Copyright (C) The Arvados Authors. All rights reserved.
3 // SPDX-License-Identifier: Apache-2.0
10 "git.arvados.org/arvados.git/lib/cli"
11 "git.arvados.org/arvados.git/lib/cmd"
12 "git.arvados.org/arvados.git/lib/deduplicationreport"
13 "git.arvados.org/arvados.git/lib/diagnostics"
14 "git.arvados.org/arvados.git/lib/mount"
18 handler = cmd.Multi(map[string]cmd.Handler{
20 "version": cmd.Version,
21 "-version": cmd.Version,
22 "--version": cmd.Version,
32 "api_client_authorization": cli.APICall,
33 "api_client": cli.APICall,
34 "authorized_key": cli.APICall,
35 "collection": cli.APICall,
36 "container": cli.APICall,
37 "container_request": cli.APICall,
39 "keep_service": cli.APICall,
42 "user_agreement": cli.APICall,
44 "virtual_machine": cli.APICall,
45 "workflow": cli.APICall,
47 "connect-ssh": connectSSHCommand{},
48 "deduplication-report": deduplicationreport.Command,
49 "diagnostics": diagnostics.Command{},
50 "logs": logsCommand{},
51 "mount": mount.Command,
52 "shell": shellCommand{},
53 "sudo": sudoCommand{},
57 func fixLegacyArgs(args []string) []string {
58 flags, _ := cli.LegacyFlagSet()
59 return cmd.SubcommandToFront(args, flags)
63 os.Exit(handler.RunCommand(os.Args[0], fixLegacyArgs(os.Args[1:]), os.Stdin, os.Stdout, os.Stderr))