Skip to content

Commit

Permalink
Chore: move common options top level
Browse files Browse the repository at this point in the history
  • Loading branch information
till committed Feb 11, 2023
1 parent a107303 commit 4ae8dc4
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions lib/apt/spy2.rb
Original file line number Diff line number Diff line change
Expand Up @@ -15,11 +15,11 @@
# apt-spy2 command interface
class AptSpy2 < Thor
package_name 'apt-spy2'
class_option :country, default: 'mirrors'
class_option :launchpad, type: :boolean, banner: "Use launchpad's mirror list"

desc 'fix', 'Set the closest/fastest mirror'
option :country, default: 'mirrors'
option :commit, type: :boolean
option :launchpad, type: :boolean, banner: "Use launchpad's mirror list"
option :strict, type: :boolean
def fix
mirrors = retrieve(options[:country], use_launchpad?(options))
Expand All @@ -36,10 +36,8 @@ def fix
end

desc 'check', 'Evaluate mirrors'
option :country, default: 'mirrors'
option :output, type: :boolean, default: true
option :format, default: 'shell'
option :launchpad, type: :boolean, banner: "Use launchpad's mirror list"
option :strict, type: :boolean
def check
@writer = Apt::Spy2::Writer.new(options[:format])
Expand All @@ -51,9 +49,7 @@ def check
end

desc 'list', 'List the currently available mirrors'
option :country, default: 'mirrors'
option :format, default: 'shell'
option :launchpad, type: :boolean, banner: "Use launchpad's mirror list"
def list
mirrors = retrieve(options[:country], use_launchpad?(options))

Expand Down

0 comments on commit 4ae8dc4

Please sign in to comment.