Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Sign in
Toggle navigation
F
Front-End
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
abdullh.alsoleman
Front-End
Commits
5678c124
Commit
5678c124
authored
Sep 15, 2015
by
Ian Fischer
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add verbose flag to sky_tools and basic logging capabilities.
parent
e6b45c50
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
0 deletions
+14
-0
sky_tools.dart
packages/flutter_tools/bin/sky_tools.dart
+14
-0
No files found.
packages/flutter_tools/bin/sky_tools.dart
View file @
5678c124
...
...
@@ -5,17 +5,27 @@
import
'dart:io'
;
import
'package:args/args.dart'
;
import
'package:logging/logging.dart'
;
import
'package:sky_tools/src/common.dart'
;
import
'package:sky_tools/src/init.dart'
;
import
'package:sky_tools/src/install.dart'
;
void
main
(
List
<
String
>
args
)
{
Logger
.
root
.
level
=
Level
.
WARNING
;
Logger
.
root
.
onRecord
.
listen
((
LogRecord
rec
)
{
print
(
'
${rec.level.name}
:
${rec.message}
'
);
});
Map
<
String
,
CommandHandler
>
handlers
=
{};
ArgParser
parser
=
new
ArgParser
();
parser
.
addSeparator
(
'options:'
);
parser
.
addFlag
(
'help'
,
abbr:
'h'
,
negatable:
false
,
help:
'Display this help message.'
);
parser
.
addFlag
(
'verbose'
,
abbr:
'v'
,
negatable:
false
,
help:
'Noisy logging, including all shell commands executed.'
);
parser
.
addSeparator
(
'commands:'
);
for
(
CommandHandler
handler
in
[
...
...
@@ -35,6 +45,10 @@ void main(List<String> args) {
exit
(
1
);
}
if
(
results
[
'verbose'
])
{
Logger
.
root
.
level
=
Level
.
INFO
;
}
if
(
results
[
'help'
])
{
_printUsage
(
parser
,
handlers
);
}
else
if
(
results
.
command
!=
null
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment