Skip to content

Commit 122bc58

Browse files
committed
ok
1 parent 5c7a24d commit 122bc58

File tree

5 files changed

+45
-17
lines changed

5 files changed

+45
-17
lines changed

astra-shell/src/main/java/com/datastax/astra/shell/AstraShell.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
import com.datastax.astra.shell.cmd.db.DbCreateShell;
99
import com.datastax.astra.shell.cmd.db.DbDeleteShell;
1010
import com.datastax.astra.shell.cmd.db.DbGetShell;
11+
import com.datastax.astra.shell.cmd.db.DbInfoShell;
1112
import com.datastax.astra.shell.cmd.db.DbListShell;
1213
import com.datastax.astra.shell.cmd.db.DbUseShell;
1314
import com.datastax.astra.shell.cmd.db.OperationsDb;
@@ -43,18 +44,18 @@
4344

4445
// With selected db
4546
DbCreateKeyspaceShell.class,
46-
DbGetShell.class,
47+
DbInfoShell.class,
4748
DbCqlShellShell.class,
4849
QuitCommand.class,
4950
},
5051
groups = {
5152
@Group(name = OperationsDb.DB, description = "Commands acting of database", commands = {
52-
DbCreateShell.class,
53-
DbDeleteShell.class,
53+
DbCreateShell.class,
54+
DbDeleteShell.class,
5455
DbListShell.class,
55-
DbGetShell.class,
56-
57-
DbUseShell.class,
56+
DbGetShell.class,
57+
DbInfoShell.class,
58+
DbUseShell.class
5859
}),
5960
@Group(name = OperationsDb.CMD_KEYSPACE, description = "Manage keyspaces (db must be selected)", commands = {
6061
DbCreateKeyspaceShell.class,
@@ -64,9 +65,9 @@
6465
RoleGetCli.class
6566
}),
6667
@Group(name= OperationIam.COMMAND_USER, description = "Manage users permission", commands = {
67-
UserListShell.class,
68-
UserGetShell.class,
69-
UserInviteShell.class,
68+
UserListShell.class,
69+
UserGetShell.class,
70+
UserInviteShell.class,
7071
UserDeleteShell.class
7172
})
7273
})

astra-shell/src/main/java/com/datastax/astra/shell/cmd/config/ConfigSetup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ public void run() {
7070
}
7171
}
7272
ShellPrinter.println("\n[What's NEXT ?]", Ansi.Color.CYAN);
73-
System.out.println("You are all set. You can now:");
73+
System.out.println("You are all set.(configuration is stored in ~/.astrarc) You can now:");
7474
System.out.println(" • Use any command, 'astra help' will get you the list");
7575
System.out.println(" • Try with 'astra db list'");
7676
System.out.println(" • Enter interactive mode using 'astra'");
Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,24 +1,28 @@
11
package com.datastax.astra.shell.cmd.db;
22

33
import com.datastax.astra.shell.ExitCode;
4-
import com.datastax.astra.shell.ShellContext;
4+
import com.datastax.astra.shell.cmd.BaseCommand;
55
import com.datastax.astra.shell.cmd.BaseShellCommand;
6+
import com.github.rvesse.airline.annotations.Arguments;
67
import com.github.rvesse.airline.annotations.Command;
8+
import com.github.rvesse.airline.annotations.restrictions.Required;
79

810
/**
911
* Display information relative to a db.
1012
*
1113
* @author Cedrick LUNVEN (@clunven)
1214
*/
13-
@Command(name = "info", description = "Show details of a database (db must be selected)")
15+
@Command(name = BaseCommand.GET, description = "Show details of a database")
1416
public class DbGetShell extends BaseShellCommand {
1517

18+
/** name of the DB. */
19+
@Required
20+
@Arguments(title = "DB", description = "Database name or identifier")
21+
public String database;
22+
1623
/** {@inheritDoc} */
1724
public ExitCode execute() {
18-
if (!dbSelected()) {
19-
return ExitCode.CONFLICT;
20-
}
21-
return OperationsDb.showDb(ShellContext.getInstance().getDatabase().getId());
25+
return OperationsDb.showDb(database);
2226
}
2327

2428
}
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
package com.datastax.astra.shell.cmd.db;
2+
3+
import com.datastax.astra.shell.ExitCode;
4+
import com.datastax.astra.shell.ShellContext;
5+
import com.datastax.astra.shell.cmd.BaseShellCommand;
6+
import com.github.rvesse.airline.annotations.Command;
7+
8+
/**
9+
* Display information relative to a db.
10+
*
11+
* @author Cedrick LUNVEN (@clunven)
12+
*/
13+
@Command(name = "info", description = "Show details of a database (db must be selected)")
14+
public class DbInfoShell extends BaseShellCommand {
15+
16+
/** {@inheritDoc} */
17+
public ExitCode execute() {
18+
if (!dbSelected()) {
19+
return ExitCode.CONFLICT;
20+
}
21+
return OperationsDb.showDb(ShellContext.getInstance().getDatabase().getId());
22+
}
23+
24+
}

astra-shell/src/main/java/com/datastax/astra/shell/cmd/shell/ConnectCommand.java

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
import com.datastax.astra.sdk.config.AstraClientConfig;
66
import com.datastax.astra.shell.ExitCode;
7-
import com.datastax.astra.shell.ShellContext;
87
import com.datastax.astra.shell.cmd.BaseShellCommand;
98
import com.datastax.astra.shell.out.LoggerShell;
109
import com.github.rvesse.airline.annotations.Arguments;

0 commit comments

Comments
 (0)