@@ -37,14 +37,14 @@ pub struct Args {
3737 pub format : core:: OutputFormat ,
3838
3939 /// The object format to assume when reading files that don't inherently know about it, or when writing files.
40- #[ clap( long, default_value = "sha1" , possible_values( & [ "sha1 " ] ) ) ]
40+ #[ clap( long, default_value_t = git_repository :: hash :: Kind :: default ( ) , possible_values( & [ "SHA1 " ] ) ) ]
4141 pub object_hash : git_repository:: hash:: Kind ,
4242
4343 #[ clap( subcommand) ]
4444 pub cmd : Subcommands ,
4545}
4646
47- #[ derive( Debug , clap:: Parser ) ]
47+ #[ derive( Debug , clap:: Subcommand ) ]
4848pub enum Subcommands {
4949 /// Subcommands for interacting with packs and their indices.
5050 #[ clap( subcommand) ]
@@ -68,10 +68,9 @@ pub enum Subcommands {
6868pub mod pack {
6969 use std:: { ffi:: OsString , path:: PathBuf } ;
7070
71- use clap:: AppSettings ;
7271 use gitoxide_core as core;
7372
74- #[ derive( Debug , clap:: Parser ) ]
73+ #[ derive( Debug , clap:: Subcommand ) ]
7574 pub enum Subcommands {
7675 /// Subcommands for interacting with pack indices (.idx)
7776 #[ clap( subcommand) ]
@@ -80,7 +79,6 @@ pub mod pack {
8079 #[ clap( subcommand) ]
8180 MultiIndex ( multi_index:: Subcommands ) ,
8281 /// Create a new pack with a set of objects.
83- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
8482 Create {
8583 #[ clap( long, short = 'r' ) ]
8684 /// the directory containing the '.git' repository from which objects should be read.
@@ -140,7 +138,6 @@ pub mod pack {
140138 tips : Vec < OsString > ,
141139 } ,
142140 /// Use the git-protocol to receive a pack, emulating a clone.
143- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
144141 #[ cfg( any( feature = "gitoxide-core-async-client" , feature = "gitoxide-core-blocking-client" ) ) ]
145142 Receive {
146143 /// The protocol version to use. Valid values are 1 and 2
@@ -173,7 +170,6 @@ pub mod pack {
173170 ///
174171 /// Note that this effectively removes delta compression for an average compression of 2x, creating one file per object in the process.
175172 /// Thus this should only be done to dissolve small packs after a fetch.
176- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
177173 Explode {
178174 #[ clap( long) ]
179175 /// Read written objects back and assert they match their source. Fail the operation otherwise.
@@ -211,7 +207,6 @@ pub mod pack {
211207 object_path : Option < PathBuf > ,
212208 } ,
213209 /// Verify the integrity of a pack, index or multi-index file
214- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
215210 Verify {
216211 #[ clap( flatten) ]
217212 args : VerifyOptions ,
@@ -257,18 +252,14 @@ pub mod pack {
257252 pub mod multi_index {
258253 use std:: path:: PathBuf ;
259254
260- use clap:: AppSettings ;
261-
262- #[ derive( Debug , clap:: Parser ) ]
255+ #[ derive( Debug , clap:: Subcommand ) ]
263256 pub enum Subcommands {
264257 /// Verify a multi-index quickly without inspecting objects themselves
265- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
266258 Verify {
267259 /// The path to the multi-pack-index to verify.
268260 multi_index_path : PathBuf ,
269261 } ,
270262 /// Create a multi-pack index from one or more pack index files
271- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
272263 Create {
273264 /// The path to which the multi-index file should be written, overwriting any possibly existing file.
274265 ///
@@ -287,13 +278,11 @@ pub mod pack {
287278 pub mod index {
288279 use std:: path:: PathBuf ;
289280
290- use clap:: AppSettings ;
291281 use gitoxide_core as core;
292282
293- #[ derive( Debug , clap:: Parser ) ]
283+ #[ derive( Debug , clap:: Subcommand ) ]
294284 pub enum Subcommands {
295285 /// create a pack index from a pack data file.
296- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
297286 Create {
298287 /// Specify how to iterate the pack, defaults to 'verify'
299288 ///
@@ -331,13 +320,10 @@ pub mod pack {
331320pub mod repo {
332321 use std:: path:: PathBuf ;
333322
334- use clap:: AppSettings ;
335-
336- #[ derive( Debug , clap:: Parser ) ]
323+ #[ derive( Debug , clap:: Subcommand ) ]
337324 #[ clap( alias = "repo" ) ]
338325 pub enum Subcommands {
339326 /// Verify the integrity of the entire repository
340- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
341327 Verify {
342328 #[ clap( flatten) ]
343329 args : super :: pack:: VerifyOptions ,
@@ -351,19 +337,16 @@ pub mod repo {
351337pub mod index {
352338 use std:: path:: PathBuf ;
353339
354- use clap:: AppSettings ;
355-
356- #[ derive( Debug , clap:: Parser ) ]
340+ #[ derive( Debug , clap:: Subcommand ) ]
357341 #[ clap( alias = "index" ) ]
358342 pub enum Subcommands {
359343 /// Print all entries to standard output
360- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
361344 Entries {
362345 /// The object format to assume when reading files that don't inherently know about it, or when writing files.
363- #[ clap( long, default_value = "sha1" , possible_values( & [ "sha1 " ] ) ) ]
346+ #[ clap( long, default_value_t = git_repository :: hash :: Kind :: default ( ) , possible_values( & [ "SHA1 " ] ) ) ]
364347 object_hash : git_repository:: hash:: Kind ,
365348
366- /// The path too the index file.
349+ /// The path to the index file.
367350 index_path : PathBuf ,
368351 } ,
369352 }
@@ -373,12 +356,9 @@ pub mod index {
373356pub mod commitgraph {
374357 use std:: path:: PathBuf ;
375358
376- use clap:: AppSettings ;
377-
378- #[ derive( Debug , clap:: Parser ) ]
359+ #[ derive( Debug , clap:: Subcommand ) ]
379360 pub enum Subcommands {
380361 /// Verify the integrity of a commit graph
381- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
382362 Verify {
383363 /// The path to '.git/objects/info/', '.git/objects/info/commit-graphs/', or '.git/objects/info/commit-graph' to validate.
384364 #[ clap( parse( from_os_str) ) ]
@@ -393,16 +373,14 @@ pub mod commitgraph {
393373///
394374#[ cfg( any( feature = "gitoxide-core-async-client" , feature = "gitoxide-core-blocking-client" ) ) ]
395375pub mod remote {
396- use clap:: AppSettings ;
397376 use gitoxide_core as core;
398377
399- #[ derive( Debug , clap:: Parser ) ]
378+ #[ derive( Debug , clap:: Subcommand ) ]
400379 pub enum Subcommands {
401380 /// List remote references from a remote identified by a url.
402381 ///
403382 /// This is the plumbing equivalent of `git ls-remote`.
404383 /// Supported URLs are documented here: <https://www.git-scm.com/docs/git-clone#_git_urls>
405- #[ clap( setting = AppSettings :: DisableVersionFlag ) ]
406384 RefList {
407385 /// The protocol version to use. Valid values are 1 and 2
408386 #[ clap( long, short = 'p' ) ]
0 commit comments