Skip to content

Commit

Permalink
CLI: Reduce some options scope
Browse files Browse the repository at this point in the history
  • Loading branch information
neomilium committed Oct 18, 2021
1 parent 5a03a6d commit 627fffa
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 15 deletions.
4 changes: 2 additions & 2 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2021-10-18 07:54:09 UTC using RuboCop version 1.22.1.
# on 2021-10-18 14:18:47 UTC using RuboCop version 1.22.1.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -21,7 +21,7 @@ Metrics/ClassLength:
Metrics/CyclomaticComplexity:
Max: 15

# Offense count: 15
# Offense count: 14
# Configuration parameters: CountComments, CountAsOne, ExcludedMethods, IgnoredMethods.
Metrics/MethodLength:
Max: 34
Expand Down
25 changes: 12 additions & 13 deletions lib/modulesync/cli.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,13 @@ def self.defaults
end

class Hook < Thor
class_option :project_root,
:aliases => '-c',
:desc => 'Path used by git to clone modules into. Defaults to "modules"',
:default => CLI.defaults[:project_root] || 'modules'
class_option :hook_args,
:aliases => '-a',
:desc => 'Arguments to pass to msync in the git hook'

option :hook_args,
:aliases => '-a',
:desc => 'Arguments to pass to msync in the git hook'
option :branch,
:aliases => '-b',
:desc => 'Branch name to pass to msync in the git hook',
:default => CLI.defaults[:branch]
desc 'activate', 'Activate the git hook.'
def activate
config = { :command => 'hook' }.merge(options)
Expand Down Expand Up @@ -53,11 +52,6 @@ class Base < Thor
class_option :negative_filter,
:aliases => '-x',
:desc => 'A regular expression to skip repositories.'
class_option :branch,
:aliases => '-b',
:desc => 'Branch name to make the changes in.' \
' Defaults to the default branch of the upstream repository, but falls back to "master".',
:default => CLI.defaults[:branch]
class_option :verbose,
:aliases => '-v',
:desc => 'Verbose mode',
Expand Down Expand Up @@ -137,6 +131,11 @@ class Base < Thor
:desc => 'Produce a failure exit code when there are warnings' \
' (only has effect when --skip_broken is enabled)',
:default => false
option :branch,
:aliases => '-b',
:desc => 'Branch name to make the changes in.' \
' Defaults to the default branch of the upstream repository, but falls back to "master".',
:default => CLI.defaults[:branch]

def update
config = { :command => 'update' }.merge(options)
Expand Down

0 comments on commit 627fffa

Please sign in to comment.