Browse Source

Add example CLI usage scenario

Serdyukov, Denys 4 years ago
parent
commit
00f46b9289
1 changed files with 63 additions and 0 deletions
  1. 63 0
      cli/README.md

+ 63 - 0
cli/README.md

@@ -97,3 +97,66 @@ The program can be exited by typing `exit` at any time.
 ## Displaying a list of commands
 
 `help` can be used at any time and shows a list of commands.
+
+# Example usage scenario
+```
+user@pc:~/ccats/build$ ./bin/ccats-cli
+machine mode is 0 file is  enablessl is 0 verbose is 0
+
+Please connect to a server via "connect <ip> <port>", then
+login by entering "login <username> <password>"
+or sign up and log in with "signup <username> <password>".
+
+ccats> connect 0.0.0.0
+Version check ok.
+ccats> login user pass
+Login ok.
+ccats> keyfile key.bin
+Using keyfile key.bin.
+ccats> status
+user@0.0.0.0:1234 - Status: ok
+ccats> put ./loremipsum.txt
+Begin uploading file loremipsum.txt
+ccats> extendedlist
+Files stored on server: 
+size (kBytes)  decryptable  file
+         0.51  unknown      loremipsum3.txt
+       339.98  yes          loremipsum.txt
+         0.74  plaintext    loremipsum4.txt
+       339.98  yes          somefancyfile.html
+         0.60  no           loremipsum2.txt
+ccats> queue loremipsum.txt
+File somefancyfile.txt queued succesfully.
+ccats> queue loremipsum4.txt
+File somefancyfile4.txt queued succesfully.
+ccats> extendedstatus
+
+Transfers between different servers:
+type      progress  method               bytes/sec  file
+upload         42%  tcpurgency             9000.01  loremipsum.txt
+queued          0%  tcpurgency                0.00  loremipsum4.txt
+
+ccats> get ./subpath/somefancyfile.html
+Begin downloading file somefancyfile.html.
+ccats> exit
+Disconnect successful.
+done
+```
+
+### Batchfile example
+
+The same result as above can be produced by writing all commands into a batchfile:
+```
+connect 0.0.0.0
+login user pass
+keyfile key.bin
+status
+put ./loremipsum.txt
+extendedlist
+queue loremipsum.txt
+queue loremipsum4.txt
+extendedstatus
+get ./subpath/somefancyfile.html
+exit
+```
+After calling `./bin/ccats-cli --batch batchfile.bat` these get executed and the same output from above can be found in `batchfile.bat.out`. If an error occurs, the execution is cancelled and the error can be found in `batchfile.bat.err`.