Sha256: 2a87e5b6b4de8165c54d146b34db25dee2114d183641c240ef143c488de47682
Contents?: true
Size: 1.37 KB
Versions: 1
Compression:
Stored size: 1.37 KB
Contents
# frozen_string_literal: true require 'commander' require_relative 'cli/setup' module BackupRepos class Commander include ::Commander::Methods def run program :name, 'Backup Repos' program :version, BackupRepos::VERSION program :description, 'Backup your repositories to specified directory.' command :backup do |c| c.syntax = 'backup-repos backup' c.description = 'Backup your repositories.' c.option '--config-path PATH', String, 'Path to configuration file' c.option '--backup-root DIR', String, 'Backup destination directory' c.option '--debug', String, 'Show debug information' c.option '--only LIST', String, 'Only backup specified repos or orgs. Separate by comma.' c.action do |args, options| BackupRepos.config_options = options if args[0] && %w[github bitbucket gitlab].include?(args[0].downcase) BackupRepos::Backup.new.send("process_#{args[0]}") else BackupRepos::Backup.new.process end end end command :setup do |c| c.syntax = 'backup-repos setup' c.description = 'Setup settings.' c.option '--debug', String, 'Setup with debug flag.' c.action do |_args, options| BackupRepos::CLI::Setup.new(options).call end end run! end end end
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
backup_repos-0.4.0 | lib/backup_repos/commander.rb |