diff --git a/cli-examples.txt b/cli-examples.txt index bce07a6..ebe173b 100644 --- a/cli-examples.txt +++ b/cli-examples.txt @@ -1,18 +1,18 @@ ====== Tests of CLI Plugin ====== -This page provides a set of test cases for the [[plugins:cli|CLI Plugin]] and also serves as an example of its use. +This page provides a set of test cases for the [[doku>plugin:cli|CLI Plugin]] and also serves as an example of its use. (([[https://raw.github.com/cpjobling/plugin-cli/master/cli-examples.txt]])) ===== Basic Shell Script ===== Wiki text: - - user@host:~/somedir $ ls - conf lang README screen.gif ui - info.txt manager.dat renderer.php syntax.php - user@host:~/somedir $ wc info.txt # count words in info.txt - 55 108 1032 info.txt - user@host:~/somedir $ - + + user@host:~/somedir $ ls + conf lang README screen.gif ui + info.txt manager.dat renderer.php syntax.php + user@host:~/somedir $ wc info.txt # count words in info.txt + 55 108 1032 info.txt + user@host:~/somedir $ + Rendered result: @@ -29,9 +29,20 @@ user@host:~/somedir $ ===== Shell Script with Comments ===== +Wiki text: + + + user@host:~/somedir $ ls # List current directory + conf lang README screen.gif ui + info.txt manager.dat renderer.php syntax.php + user@host:~/somedir $ + + +Rendered result: + user@host:~/somedir $ ls # List current directory -conf lang README screen,gif ui +conf lang README screen.gif ui info.txt manager.dat renderer.php syntax.php user@host:~/somedir $ @@ -42,45 +53,45 @@ user@host:~/somedir $ This (default shell comment character): - - root@host:~user/somedir # ls # List current directory - conf lang README screen,gif ui - info.txt manager.dat renderer.php syntax.php - root@host:~user/somedir # - + + root@host:~user/somedir # ls # List current directory + conf lang README screen.gif ui + info.txt manager.dat renderer.php syntax.php + root@host:~user/somedir # + renders as this: root@host:~user/somedir # ls # List current directory -conf lang README screen,gif ui +conf lang README screen.gif ui info.txt manager.dat renderer.php syntax.php root@host:~user/somedir # This is also valid: - - root@host:~user/somedir # ls # List current directory - conf lang README screen,gif ui - info.txt manager.dat renderer.php syntax.php - root@host:~user/somedir # - + + root@host:~user/somedir # ls # List current directory + conf lang README screen.gif ui + info.txt manager.dat renderer.php syntax.php + root@host:~user/somedir # + root@host:~user/somedir # ls # List current directory -conf lang README screen,gif ui +conf lang README screen.gif ui info.txt manager.dat renderer.php syntax.php root@host:~user/somedir # Example with a continuation prompt: - - user@host:~/somedir $ ls \ - > # List directory - file1 file2 - + + user@host:~/somedir $ ls \ + > # List directory + file1 file2 + user@host:~/somedir $ ls \ @@ -91,9 +102,20 @@ file1 file2 ===== Shell Script with Comments ===== +Wiki text: + + + user@host:~/somedir $ ls # List current directory + conf lang README screen.gif ui + info.txt manager.dat renderer.php syntax.php + user@host:~/somedir $ + + +Rendered result: + user@host:~/somedir $ ls # List current directory -conf lang README screen,gif ui +conf lang README screen.gif ui info.txt manager.dat renderer.php syntax.php user@host:~/somedir $ @@ -104,11 +126,11 @@ user@host:~/somedir $ Wiki text: - -C:\Users\User>REM hello world! -C:\Users\User>echo 'hello world!' -'hello world!' - + + C:\Users\User>REM hello world! + C:\Users\User>echo 'hello world!' + 'hello world!' + Rendered result: @@ -121,6 +143,17 @@ C:\Users\User>echo 'hello world!' ===== Ruby irb ===== Simple minded implementation will not work for results as end of prompt is same as results marker! + +Wiki text: + + + irb(main):001:0> 2+2 + => 4 + irb(main):002:0> + + +Rendered result: + irb(main):001:0> 2+2 => 4 @@ -129,6 +162,20 @@ irb(main):002:0> ===== Python ===== +Wiki text: + + + ActivePython 2.5.1.1 (ActiveState Software Inc.) based on + Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on + win32 + Type "help", "copyright", "credits" or "license" for more information. + >>> 2+2 + 4 + >>> + + +Rendered result: + ActivePython 2.5.1.1 (ActiveState Software Inc.) based on Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on @@ -144,23 +191,24 @@ Type "help", "copyright", "credits" or "license" for more information. ===== Python + Windows Shell (Nested CLIs) ===== Wiki text: - - C:\Users\Chris Jobling>python - - ActivePython 2.5.1.1 (ActiveState Software Inc.) based on - Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on - win32 - Type "help", "copyright", "credits" or "license" for more information. - >>> 2+2 - 4 - >>> ^Z - - - C:\Users\Chris Jobling> - + + + C:\Users\Chris Jobling>python + + ActivePython 2.5.1.1 (ActiveState Software Inc.) based on + Python 2.5.1 (r251:54863, May 1 2007, 17:47:05) [MSC v.1310 32 bit (Intel)] on + win32 + Type "help", "copyright", "credits" or "license" for more information. + >>> 2+2 + 4 + >>> ^Z + + + C:\Users\Chris Jobling> + Rendered result: -Wiki text: + C:\Users\Chris Jobling>python @@ -199,9 +247,9 @@ Not sure to do about this as download progress marker uses same character as pro user@host:~/somedir $ ls # List current directory -conf lang README screen,gif ui +conf lang README screen.gif ui info.txt manager.dat renderer.php syntax.php user@host:~/somedir $ # I intended there to be two blank lines above! - \ No newline at end of file +