code: function main(args) {
      let onetime = false;
      let down = false;
      if (!args[0]) return usage();
      switch (args[0]) {
          case "--debug":
              sh.options.debug = true;
              return main(args.slice(1));
          case "-v":
              echo`Version ${currentVersion}`;
              break;
          case "-o":
              getConfiguredDownloadClient();
              if (configuredDownloadClient !== "curl")
                  throw new Error("curl must be installed to use one time file upload");
              let {downlink} = onetimeUpload(args[1]);
              printOnetimeUpload(downlink);
              break;
          case "-d":
              if (args.length < 4) { echo`Error: not enough arguments for downloading a file, see the usage`; process.exit(1); }
              if (args.length > 4) { echo`Error: too many arguments for downloading a file, see the usage`; process.exit(1); }
              getConfiguredDownloadClient();
              singleDownload(args[1], args[2], args[3]);
              break;
          default:
              for (let i = 0; i < args.length; i++) {
                  let file = args[i];
                  if (!test`[ -e ${file} ]`) {
                      if (/^-/.test(args[i])) usage();
                      else echo`File not found: ${args[i]}`;
                      process.exit(1);
                  }
                  getConfiguredDownloadClient();
                  checkInternet();
                  getConfiguredUploadClient();
                  let {filename, response} = singleUpload(file);
                  printUploadResponse(filename, response);
                  continue;
              }
      }
  }
docs: Option parsing & command handling: could be done with a npm module like yargs;
  here we'll stay close to the original and use process.argv.