Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
git_borg_linker
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
LBMC
Hub
git_borg_linker
Commits
3f650098
Verified
Commit
3f650098
authored
2 years ago
by
nfontrod
Browse files
Options
Downloads
Patches
Plain Diff
src/delete.rs: handle_arguments_value function uses prune::get_str & prune::string_convert function
parent
b708ae81
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/delete.rs
+8
-17
8 additions, 17 deletions
src/delete.rs
with
8 additions
and
17 deletions
src/delete.rs
+
8
−
17
View file @
3f650098
...
@@ -5,7 +5,7 @@ use std::{
...
@@ -5,7 +5,7 @@ use std::{
process
::{
exit
,
Command
,
Stdio
},
process
::{
exit
,
Command
,
Stdio
},
};
};
use
crate
::
commit
;
use
crate
::
{
commit
,
prune
}
;
#[derive(Debug,
Args)]
#[derive(Debug,
Args)]
pub
(
crate
)
struct
Delete
{
pub
(
crate
)
struct
Delete
{
/// Do not change the repository
/// Do not change the repository
...
@@ -87,7 +87,7 @@ pub(crate) struct Delete {
...
@@ -87,7 +87,7 @@ pub(crate) struct Delete {
help_heading
=
"Archive filters"
,
help_heading
=
"Archive filters"
,
display_order
=
4
display_order
=
4
)]
)]
pub
(
crate
)
first
:
Option
<
i
size
>
,
pub
(
crate
)
first
:
Option
<
u
size
>
,
/// consider last N archives after other filters were applied
/// consider last N archives after other filters were applied
#[clap(
#[clap(
long,
long,
...
@@ -95,7 +95,7 @@ pub(crate) struct Delete {
...
@@ -95,7 +95,7 @@ pub(crate) struct Delete {
help_heading
=
"Archive filters"
,
help_heading
=
"Archive filters"
,
display_order
=
5
display_order
=
5
)]
)]
pub
(
crate
)
last
:
Option
<
i
size
>
,
pub
(
crate
)
last
:
Option
<
u
size
>
,
/// Name of archives to delete
/// Name of archives to delete
#[clap(
#[clap(
help_heading
=
"Positional Arguments"
,
help_heading
=
"Positional Arguments"
,
...
@@ -159,20 +159,11 @@ fn handle_force_arguments(margs: &mut Vec<String>, sd: &Delete) {
...
@@ -159,20 +159,11 @@ fn handle_force_arguments(margs: &mut Vec<String>, sd: &Delete) {
/// A boolean indicating if Archive filters are used. Also Update `margs` parameter
/// A boolean indicating if Archive filters are used. Also Update `margs` parameter
fn
handle_arguments_value
(
margs
:
&
mut
Vec
<
String
>
,
sd
:
&
Delete
)
->
bool
{
fn
handle_arguments_value
(
margs
:
&
mut
Vec
<
String
>
,
sd
:
&
Delete
)
->
bool
{
let
va
:
HM
<&
str
,
String
>
=
HM
::
from
([
let
va
:
HM
<&
str
,
String
>
=
HM
::
from
([
(
"--prefix"
,
sd
.prefix
.clone
()
.unwrap_or
(
String
::
from
(
""
))),
(
"--prefix"
,
prune
::
get_str
(
&
sd
.prefix
)),
(
(
"--glob-archives"
,
prune
::
get_str
(
&
sd
.glob_archives
)),
"--glob-archives"
,
(
"--sort-by"
,
prune
::
get_str
(
&
sd
.sort_by
)),
sd
.glob_archives
.clone
()
.unwrap_or
(
String
::
from
(
""
)),
(
"--first"
,
prune
::
string_convert
(
sd
.first
)),
),
(
"--last"
,
prune
::
string_convert
(
sd
.last
)),
(
"--sort-by"
,
sd
.sort_by
.clone
()
.unwrap_or
(
String
::
from
(
""
))),
(
"--first"
,
sd
.first
.unwrap_or
(
-
1
)
.to_string
()
.replace
(
"-1"
,
""
),
),
(
"--last"
,
sd
.last
.unwrap_or
(
-
1
)
.to_string
()
.replace
(
"-1"
,
""
),
),
]);
]);
let
mut
count
=
0
;
let
mut
count
=
0
;
for
(
name
,
value
)
in
va
{
for
(
name
,
value
)
in
va
{
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment