Sha256: 9c8b246edc5fc8c3a48bec270105fad69eb17cb935ec544b9962e01eee7c1901

Contents?: true

Size: 1.18 KB

Versions: 5

Compression:

Stored size: 1.18 KB

Contents

#!/usr/bin/env ruby

require 'big_stash/version'
require 'big_stash/stash_operator'

require 'gli'

include GLI::App

module BigStash
  # Your code goes here...
  program_desc 'Enhancement for git stash'

  flag [:p,:path], :default_value => './'

  path = ''

  pre do |global_options,command,options,args|
    path = global_options[:path]
  end

  desc 'Add a stash with name'
  command :add do |c|
    c.action do |global_options, options, args|
      help_now!('stash name is required') if args.empty?
      BigStash::StashOperator.new(path).stash(args.first)
    end
  end

  desc 'Apply a stash with name'
  command :apply do |c|
    c.action do |global_options, options, args|
      help_now!('stash name is required') if args.empty?
      BigStash::StashOperator.new(path).apply_stash(args.first)
    end
  end

  desc 'Pop a stash with name'
  command :pop do |c|
    c.action do |global_options, options, args|
      help_now!('stash name is required') if args.empty?
      BigStash::StashOperator.new(path).pop_stash(args.first)
    end
  end

  desc 'List all the stashes'
  command :list do |c|
    c.action do
      p BigStash::StashOperator.new(path).stashes
    end
  end

  exit run(ARGV)
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
big_stash-0.6.0 lib/big_stash.rb
big_stash-0.5.0 lib/big_stash.rb
big_stash-0.4.0 lib/big_stash.rb
big_stash-0.3.0 lib/big_stash.rb
big_stash-0.2.0 lib/big_stash.rb