summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMaurizio Lombardi <mlombard@redhat.com>2019-11-05 09:33:21 +0100
committerGitHub <noreply@github.com>2019-11-05 09:33:21 +0100
commit2ad30ddb9d38ad231ef6de19d925beb177d27a10 (patch)
tree26395cd841d75a780533d49a0accfe796eb83fe2
parent536b14629b28079391a2bde6dd7d36d50f13bbf2 (diff)
parent9cdf76f57ab71a3622acfa910983844b6bfabd36 (diff)
downloadtargetcli-2ad30ddb9d38ad231ef6de19d925beb177d27a10.tar.gz
Merge pull request #154 from pkalever/deprecate-tcp-option
targetcli: depreciate the redundant '--tcp' option
-rwxr-xr-xscripts/targetcli16
-rw-r--r--targetclid.89
2 files changed, 4 insertions, 21 deletions
diff --git a/scripts/targetcli b/scripts/targetcli
index 49355e3..04e5aba 100755
--- a/scripts/targetcli
+++ b/scripts/targetcli
@@ -67,13 +67,11 @@ class TargetCLI(ConfigShell):
}
def usage():
- print("Usage: %s [--version|--help|CMD|--tcp|--disable-daemon]" % sys.argv[0], file=err)
+ print("Usage: %s [--version|--help|CMD|--disable-daemon]" % sys.argv[0], file=err)
print(" --version\t\tPrint version", file=err)
print(" --help\t\tPrint this information", file=err)
print(" CMD\t\t\tRun targetcli shell command and exit", file=err)
print(" <nothing>\t\tEnter configuration shell", file=err)
- print(" --tcp CMD\t\tPass targetcli command to targetclid", file=err)
- print(" --tcp <nothing>\tEnter multi-line command mode for targetclid", file=err)
print(" --disable-daemon\tTurn-off the global auto use daemon flag", file=err)
print("See man page for more information.", file=err)
sys.exit(-1)
@@ -172,12 +170,8 @@ def get_arguments(shell):
else:
readline.parse_and_bind("tab: complete")
- argstart = 1
- if len(sys.argv) > 1 and sys.argv[1] in ("tcp", "--tcp", "-t"):
- argstart = 2
-
- if len(sys.argv[argstart - 1:]) > 1:
- command = " ".join(sys.argv[argstart:])
+ if len(sys.argv) > 1:
+ command = " ".join(sys.argv[1:])
else:
inputs = []
shell.con.display("targetcli shell version %s\n"
@@ -227,9 +221,7 @@ def main():
disable_daemon=False
if len(sys.argv) > 1:
usage_version(sys.argv[1])
- if sys.argv[1] in ("tcp", "--tcp", "-t"):
- use_daemon = True
- elif sys.argv[1] in ("disable-daemon", "--disable-daemon"):
+ if sys.argv[1] in ("disable-daemon", "--disable-daemon"):
disable_daemon=True
if use_daemon and not disable_daemon:
diff --git a/targetclid.8 b/targetclid.8
index a2518b4..a783091 100644
--- a/targetclid.8
+++ b/targetclid.8
@@ -52,15 +52,6 @@ Enter multiple commands separated by newline and type 'exit' to run them all in
You can set preference to stop using daemonized mode even when the daemon is not running,
.br
$ targetcli --disable-daemon
-.TP
-If you want to selectively run commands through daemon while default mode is cli (auto_use_daemon=false), you can use,
-.br
-$ targetcli --tcp ls
-.br
-For batch mode,
-.br
-$ targetcli --tcp <hit-enter>
-.P
.SH FILES
.B /etc/target/saveconfig.json
.br