Skip to content

Commit d1e200a

Browse files
committed
Added 'scw _billing' placeholder
1 parent e10ccec commit d1e200a

File tree

3 files changed

+41
-4
lines changed

3 files changed

+41
-4
lines changed

pkg/cli/commands.go

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,10 @@ var Commands = []*Command{
1313

1414
cmdAttach,
1515
cmdCommit,
16-
cmdCompletion,
1716
cmdCp,
1817
cmdCreate,
1918
cmdEvents,
2019
cmdExec,
21-
cmdFlushCache,
2220
cmdHistory,
2321
cmdImages,
2422
cmdInfo,
@@ -27,7 +25,6 @@ var Commands = []*Command{
2725
cmdLogin,
2826
cmdLogout,
2927
cmdLogs,
30-
cmdPatch,
3128
cmdPort,
3229
cmdPs,
3330
cmdRename,
@@ -43,4 +40,9 @@ var Commands = []*Command{
4340
cmdUserdata,
4441
cmdVersion,
4542
cmdWait,
43+
44+
cmdBilling,
45+
cmdCompletion,
46+
cmdFlushCache,
47+
cmdPatch,
4648
}

pkg/cli/test.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ var (
1717
"version", "wait",
1818
}
1919
secretCommands []string = []string{
20-
"_patch", "_completion", "_flush-cache", "_userdata",
20+
"_patch", "_completion", "_flush-cache", "_userdata", "_billing",
2121
}
2222
publicOptions []string = []string{
2323
"-h, --help=false",

pkg/cli/x_billing.go

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
// Copyright (C) 2015 Scaleway. All rights reserved.
2+
// Use of this source code is governed by a MIT-style
3+
// license that can be found in the LICENSE.md file.
4+
5+
package cli
6+
7+
import "fmt"
8+
9+
var cmdBilling = &Command{
10+
Exec: runBilling,
11+
UsageLine: "_billing [OPTIONS]",
12+
Description: "",
13+
Hidden: true,
14+
Help: "Get resources billing estimation",
15+
}
16+
17+
func init() {
18+
cmdBilling.Flag.BoolVar(&billingHelp, []string{"h", "-help"}, false, "Print usage")
19+
}
20+
21+
// Flags
22+
var billingHelp bool // -h, --help flag
23+
24+
func runBilling(cmd *Command, args []string) error {
25+
if billingHelp {
26+
return cmd.PrintUsage()
27+
}
28+
if len(args) > 0 {
29+
return cmd.PrintShortUsage()
30+
}
31+
32+
fmt.Println("BILLING")
33+
34+
return nil
35+
}

0 commit comments

Comments
 (0)