Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Macao Legacy
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
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
MACAO
Macao Legacy
Commits
c5616c6f
Commit
c5616c6f
authored
10 months ago
by
Eliott Sammier
Browse files
Options
Downloads
Patches
Plain Diff
More CLI fixes
parent
a6d710f1
No related branches found
No related tags found
1 merge request
!5
Resolve "Parseur par type d'activité"
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
mcli
+49
-35
49 additions, 35 deletions
mcli
with
49 additions
and
35 deletions
mcli
+
49
−
35
View file @
c5616c6f
...
@@ -2,17 +2,23 @@
...
@@ -2,17 +2,23 @@
# Default value for version env var
# Default value for version env var
if
[[
-z
"
$VERSION
"
]]
;
then
if
[[
-z
"
$VERSION
"
]]
;
then
VERSION
=
"
e
ac
h
"
VERSION
=
"
m
ac
ao_12
"
fi
fi
# First parameter overrides version if set
# First parameter overrides version if set
version_regex
=
'^(macao_12|macao_3|each|full)$'
if
[[
"
$1
"
==
"12"
||
"
$1
"
==
"3"
]]
;
then
if
[[
"
$1
"
==
"12"
||
"
$1
"
==
"3"
]]
;
then
VERSION
=
"macao_
$1
"
VERSION
=
"macao_
$1
"
shift
shift
elif
[[
"
$1
"
=
"each"
||
"
$1
"
=
"full"
]]
;
then
elif
[[
"
$1
"
=
~
$version_regex
]]
;
then
VERSION
=
"
$1
"
VERSION
=
"
$1
"
shift
shift
fi
fi
export
VERSION
export
VERSION
if
[[
!
"
$VERSION
"
=
~
$version_regex
]]
;
then
echo
"Invalid version '
$VERSION
'"
exit
1
fi
# Special version value "each" is processed by calling the script itself once
# Special version value "each" is processed by calling the script itself once
# for each actual version
# for each actual version
if
[[
"
$VERSION
"
=
"each"
&&
"
$1
"
!=
"shell"
&&
"
$1
"
!=
"status"
&&
"
$1
"
!=
"setup"
]]
;
then
if
[[
"
$VERSION
"
=
"each"
&&
"
$1
"
!=
"shell"
&&
"
$1
"
!=
"status"
&&
"
$1
"
!=
"setup"
]]
;
then
...
@@ -35,8 +41,14 @@ print_usage() {
...
@@ -35,8 +41,14 @@ print_usage() {
cat
<<
EOF
cat
<<
EOF
Usage:
$(
basename
"
$0
"
)
[version] <command> [args]
Usage:
$(
basename
"
$0
"
)
[version] <command> [args]
COMMANDS
VERSION
Specifies which part of the MACAO repository to use: "macao_12", "macao_3"
(or simply "12" and "3"), "each" for both in separate result dirs
and "full" for both merged in a single result dir.
If not specified, uses the value of the "VERSION" environment variable,
or "12" by default. Some commands do not support every version.
COMMANDS
status
status
Print useful info about the current environment.
Print useful info about the current environment.
shell [-p|--pyenv]
shell [-p|--pyenv]
...
@@ -50,7 +62,8 @@ index-extensions
...
@@ -50,7 +62,8 @@ index-extensions
Index all files by extension
Index all files by extension
count-all [-f|--force]
count-all [-f|--force]
Count many types of Macao objects.
Count many types of Macao objects.
If -f or --force is given, refresh indexes before counting (equivalent to count-streams and index-extensions)
If -f or --force is given, refresh indexes before counting (equivalent
to count-streams and index-extensions)
setup
setup
Initialize Python environment required by extractors
Initialize Python environment required by extractors
setup-debug
setup-debug
...
@@ -131,6 +144,7 @@ index_extensions() {
...
@@ -131,6 +144,7 @@ index_extensions() {
allfiles
=
"
$(
find
.
-path
'**/.idea'
-prune
-o
-type
f
-print
)
"
allfiles
=
"
$(
find
.
-path
'**/.idea'
-prune
-o
-type
f
-print
)
"
cd
-
||
exit
cd
-
||
exit
# List all extensions, then for each one, filter the index for files with this extension
# List all extensions, then for each one, filter the index for files with this extension
# ( Perl expression courtesy of https://stackoverflow.com/a/1842270 )
perl
-ne
'print $1 if m/\.([^.\/]+)$/**//'
<<<
"
$allfiles
"
|
sort
-u
|
while
read
-r
ext
;
do
perl
-ne
'print $1 if m/\.([^.\/]+)$/**//'
<<<
"
$allfiles
"
|
sort
-u
|
while
read
-r
ext
;
do
echo
"[
$ext
]"
>>
"
$out_file
"
echo
"[
$ext
]"
>>
"
$out_file
"
grep
-E
".*
\.
$ext
\$
"
<<<
"
$allfiles
"
|
sort
>>
"
$out_file
"
grep
-E
".*
\.
$ext
\$
"
<<<
"
$allfiles
"
|
sort
>>
"
$out_file
"
...
...
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