15397: Remove usage of default_owner_uuid.
[arvados.git] / cmd / arvados-client / cmd.go
1 // Copyright (C) The Arvados Authors. All rights reserved.
2 //
3 // SPDX-License-Identifier: Apache-2.0
4
5 package main
6
7 import (
8         "os"
9
10         "git.arvados.org/arvados.git/lib/cli"
11         "git.arvados.org/arvados.git/lib/cmd"
12         "git.arvados.org/arvados.git/lib/costanalyzer"
13         "git.arvados.org/arvados.git/lib/deduplicationreport"
14         "git.arvados.org/arvados.git/lib/diagnostics"
15         "git.arvados.org/arvados.git/lib/mount"
16 )
17
18 var (
19         handler = cmd.Multi(map[string]cmd.Handler{
20                 "-e":        cmd.Version,
21                 "version":   cmd.Version,
22                 "-version":  cmd.Version,
23                 "--version": cmd.Version,
24
25                 "copy":   cli.Copy,
26                 "create": cli.Create,
27                 "edit":   cli.Edit,
28                 "get":    cli.Get,
29                 "keep":   cli.Keep,
30                 "tag":    cli.Tag,
31                 "ws":     cli.Ws,
32
33                 "api_client_authorization": cli.APICall,
34                 "api_client":               cli.APICall,
35                 "authorized_key":           cli.APICall,
36                 "collection":               cli.APICall,
37                 "container":                cli.APICall,
38                 "container_request":        cli.APICall,
39                 "group":                    cli.APICall,
40                 "keep_service":             cli.APICall,
41                 "link":                     cli.APICall,
42                 "log":                      cli.APICall,
43                 "user_agreement":           cli.APICall,
44                 "user":                     cli.APICall,
45                 "virtual_machine":          cli.APICall,
46                 "workflow":                 cli.APICall,
47
48                 "connect-ssh":          connectSSHCommand{},
49                 "costanalyzer":         costanalyzer.Command,
50                 "deduplication-report": deduplicationreport.Command,
51                 "diagnostics":          diagnostics.Command{},
52                 "logs":                 logsCommand{},
53                 "mount":                mount.Command,
54                 "shell":                shellCommand{},
55                 "sudo":                 sudoCommand{},
56         })
57 )
58
59 func fixLegacyArgs(args []string) []string {
60         flags, _ := cli.LegacyFlagSet()
61         return cmd.SubcommandToFront(args, flags)
62 }
63
64 func main() {
65         os.Exit(handler.RunCommand(os.Args[0], fixLegacyArgs(os.Args[1:]), os.Stdin, os.Stdout, os.Stderr))
66 }