bin/aptly-cli in aptly_cli-0.0.1 vs bin/aptly-cli in aptly_cli-0.0.2

- old
+ new

@@ -1,11 +1,33 @@ #!/usr/bin/env ruby require 'rubygems' require 'commander/import' +require 'aptly_cli' program :version, '0.0.1' program :description, 'Aptly repository API client' + +command :file do |c| + c.syntax = 'aptly-cli file [options]' + c.summary = 'Upload package files temporarily to aptly service' + + c.description = 'All uploaded files are stored under <rootDir>/upload directory (see configuration). This directory would be created automatically if it doesn’t exist. Uploaded files are grouped by directories to support concurrent uploads from multiple package sources. Local repos add API can operate on directory (adding all files from directory) or on individual package files. By default, all successfully added package files would be removed.' + + c.example 'List of directories or files', 'aptly-cli file --list / or aptly-cli file --list /redis' + c.example 'Upload file to a directory', 'aptly-cli file --upload /tmp/redis/test_1.0_amd64.deb --dest_uri /redis' + c.example 'Delete file or directory', 'aptly-cli file --delete /test/test_1.0_amd64.deb' + c.option '--list URI_FILE_PATH', String, 'URI path to list files' + c.option '--upload LOCAL_FILE_PATH/PACKAGE', String, 'Path to package to upload' + c.option '--dest_uri URI_FILE_PATH', String, 'URI path to directory to upload into' + c.option '--delete URI_FILE_PATH/PACKAGE', String, 'URI path to directory to delete or specific package' + c.action do |args, options| + aptly_command = AptlyCli::AptlyFile.new + puts aptly_command.file_get(options.list) if options.list + puts aptly_command.file_post(:file_uri => options.dest_uri, :package => options.upload, :local_file => options.upload) if options.upload and options.dest_uri + puts aptly_command.file_delete(options.delete) if options.delete + end +end command :repo do |c| c.syntax = 'aptly-cli repo [options]' c.summary = '' c.description = ''