bin/detom in detom-0.0.1 vs bin/detom in detom-0.0.2

- old
+ new

@@ -32,22 +32,39 @@ end end end desc "Record some time spent on a client. <client> and <time> are required. <client> is the name of the client and <time> is an amount of time in minutes, e.g. 39m, or hours, e.g. 3h" - arg_name "<client> <time>" + arg_name "<time> <client>" command :record do |c| c.flag [:d, :"day-month"] c.action do |global_options, options, args| - help_now! "You must provide record with <client> and <time> as arguments" if args.length < 2 - begin store = YamlFileStore.new - Commands::Record.new(store).call args[0], args[1], options[:d] + local_config = Detom::LocalConfig.new + Commands::Record.new(store, local_config) + .call args[0], args[1], options[:d] rescue StandardError => e STDERR.puts e.message STDERR.puts e.backtrace end + end + end + + desc "Sets a default client and project for the current folder, by creating or updating a .detom file. Run in the root of a project directory" + arg_name "<client> [project]" + command :set do |c| + c.action do |global_options, options, args| + Commands::Set.new.call args[0], args[1] + end + end + + desc "Outputs time tracked against one client in detail." + arg_name "<client>" + command :client do |c| + c.action do |global_options, options, args| + store = YamlFileStore.new + Commands::Client.new(store).call args[0] end end desc "Archive tracking for a client or a project. Literally copies the client file into ~/.detom/archive/client-<today>.json" arg_name "client"