Fingercomp 37 Posted February 10, 2016 Share Posted February 10, 2016 This program can download gists, upload files to gist and do some more things. It uses JSON library, which will be downloaded automatically if it is missing. Usage: For example, you need to upload some junk. To do this, you need to specify -p flag. --P=s flag makes your gist to be a secret one (it will not show up in lists). Use --desc="description" to provide a description for a gist. Then you should specify each file you want to upload as argument. (/path/to/the/file/on/computer.lua=fileOnGistWith.ext). The command will look like this: gist -p --P=s --desc="Hello, world!" /examples/hello.c=helloworld.c /examples/hello.lua=helloworld.lua You will get a long URL to the created gist, like this one: https://gist.github.com/anonymous/a2b3c5d7e9f1a3b5c7d9e That's why there's a -s option. If you specify it when uploading, you'll get a short URL. Let's assume you want to download this gist. If you type the following command: gist a2b3c5d7e9f1a3b5c7d9e the contents of the gist will be printed on the screen. But what if there are multiple files? Then you'll get an error with a list of files. So I need to choose one and specify it with the --f option: --f=helloworld.c. If this program was unable to save contents to a file, I think, it would be useless. So if you need to save gist to the file /tmp/helloworld.c, you should place it after the gist ID. gist --f=helloworld.c a2b3c5d7e9f1a3b5c7d9e /tmp/helloworld.c If the output file existed, you had to specify -r flag. Instead of gist ID you can use Git.io URL. There's some other options left. -s. Shorten a specified URL via Git.io. -R. Show a raw file contents URL. -q. Quiet mode: do not show regular info. -Q. Superquiet mode: do not show errors. -l. List files in a gist. -i. Show info about file. -G. Show info about gist. If you won't specify any arguments, the help will be displayed. Download: wget https://raw.githubusercontent.com/OpenPrograms/Fingercomp-Programs/master/gist/gist.lua gist.lua Quote Link to post Share on other sites