From 87765a808eb747315f8ed776f428214d2af2fb11 Mon Sep 17 00:00:00 2001 From: Prodesire Date: Sat, 11 Nov 2017 20:23:19 +0800 Subject: [PATCH] add pydu.cmd.cmdline_argv() to cmd doc --- docs/cmd.rst | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/docs/cmd.rst b/docs/cmd.rst index 7ae322b..d3d435f 100644 --- a/docs/cmd.rst +++ b/docs/cmd.rst @@ -14,3 +14,17 @@ Cmd (0, b'hello\r\n') # Python 3 >>> execute('echo hello', wait=False) + + +.. function:: pydu.cmd.cmdline_argv() + + Get command line argv of self python process. On Windows when using Python 2, + ``cmdline_argv`` is implemented by using ``shell32.GetCommandLineArgvW`` to get + sys.argv as a list of Unicode strings. On other system or using Python 3, + ``cmdline_argv`` is same to ``sys.argv``. + + There is an example on PyCharm Python Console: + + >>> from pydu.cmd import cmdline_argv + >>> cmdline_argv() + ['/Applications/PyCharm.app/Contents/helpers/pydev/pydevconsole.py', '61253', '61254']