Skip to content

Commit 420912a

Browse files
committed
treat help as an action
1 parent b27d0a6 commit 420912a

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

kyuubi-ctl/src/test/scala/org/apache/kyuubi/ctl/KyuubiCtlArgumentsSuite.scala

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,12 +65,24 @@ class KyuubiCtlArgumentsSuite extends KyuubiFunSuite {
6565
assert(opArgs.version == KYUUBI_VERSION)
6666
}
6767

68-
test("prints usage on empty input") {
69-
testPrematureExit(Array.empty[String], "Usage: kyuubi-ctl")
68+
test("treat --help as action") {
69+
val args = Seq("--help")
70+
val opArgs = new KyuubiCtlArguments(args)
71+
assert(opArgs.action == KyuubiCtlAction.HELP)
72+
73+
val args2 = Seq(
74+
"create", "server",
75+
"--help",
76+
"--user", user,
77+
"--host", host,
78+
"--port", port
79+
)
80+
val opArgs2 = new KyuubiCtlArguments(args2)
81+
assert(opArgs2.action == KyuubiCtlAction.HELP)
7082
}
7183

72-
test("prints usage with only --help") {
73-
testPrematureExit(Array("--help"), "Usage: kyuubi-ctl")
84+
test("prints usage on empty input") {
85+
testPrematureExit(Array.empty[String], "Usage: kyuubi-ctl")
7486
}
7587

7688
test("prints error with unrecognized options") {

0 commit comments

Comments
 (0)