Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Q
qbar
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
Container Registry
Model registry
Operate
Environments
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
Jens Nolte
qbar
Commits
b92213f0
Commit
b92213f0
authored
4 years ago
by
Mr. Snow Ball / projects
Browse files
Options
Downloads
Patches
Plain Diff
Add `qubes` command to CLI
parent
b35121a7
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/QBar/Cli.hs
+9
-1
9 additions, 1 deletion
src/QBar/Cli.hs
with
9 additions
and
1 deletion
src/QBar/Cli.hs
+
9
−
1
View file @
b92213f0
...
...
@@ -8,6 +8,7 @@ import QBar.ControlSocket
import
QBar.Core
import
QBar.DefaultConfig
import
QBar.Server
import
QBar.Qubes.AdminAPI
(
printEvents
,
qubesVMStats
,
qubesEvents
)
import
QBar.Theme
import
QBar.Time
...
...
@@ -43,7 +44,8 @@ barCommandParser = hsubparser (
command
"server"
(
info
serverCommandParser
(
progDesc
"Start a new server."
))
<>
command
"mirror"
(
info
mirrorCommandParser
(
progDesc
"Mirror the output of a running server."
))
<>
command
"pipe"
(
info
pipeClientParser
(
progDesc
"Redirects the stdin of this process to a running bar."
))
<>
command
"theme"
(
info
themeCommandParser
(
progDesc
"Change the theme of the running qbar server."
))
command
"theme"
(
info
themeCommandParser
(
progDesc
"Change the theme of the running qbar server."
))
<>
command
"qubes"
(
info
qubesCommandParser
(
progDesc
"Display information about Qubes."
))
)
serverCommandParser
::
Parser
(
MainOptions
->
IO
()
)
...
...
@@ -114,3 +116,9 @@ scriptBlockParser = helper <*> do
clickEvents
<-
switch
$
long
"events"
<>
short
'e'
<>
help
"Send click events to stdin of the script"
script
<-
strArgument
(
metavar
"SCRIPT"
<>
help
"The script that will be executed with a shell."
)
return
$
(
if
poll
then
addBlock
.
pollScriptBlock
pollInterval
else
addBlock
.
scriptBlock
clickEvents
)
script
qubesCommandParser
::
Parser
(
MainOptions
->
IO
()
)
qubesCommandParser
=
hsubparser
(
command
"stats"
(
info
(
pure
$
const
$
printEvents
qubesVMStats
)
(
progDesc
"Subscribe to VM stats and print them to stdout."
))
<>
command
"events"
(
info
(
pure
$
const
$
printEvents
qubesEvents
)
(
progDesc
"Subscribe to events and print them to stdout."
))
)
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