-
Notifications
You must be signed in to change notification settings - Fork 918
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ARTEMIS-4372 Implement Pico-cli and script auto-complete
- Loading branch information
1 parent
e60bd1a
commit 4e47aee
Showing
80 changed files
with
899 additions
and
1,146 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
50 changes: 50 additions & 0 deletions
50
artemis-cli/src/main/java/org/apache/activemq/artemis/cli/commands/AutoCompletion.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
/* | ||
* Licensed to the Apache Software Foundation (ASF) under one or more | ||
* contributor license agreements. See the NOTICE file distributed with | ||
* this work for additional information regarding copyright ownership. | ||
* The ASF licenses this file to You under the Apache License, Version 2.0 | ||
* (the "License"); you may not use this file except in compliance with | ||
* the License. You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
package org.apache.activemq.artemis.cli.commands; | ||
|
||
import java.io.File; | ||
|
||
import picocli.AutoComplete; | ||
import picocli.CommandLine; | ||
|
||
@CommandLine.Command(name = "auto-complete", description = "Generates the auto complete helper file") | ||
public class AutoCompletion implements Runnable { | ||
|
||
public AutoCompletion(CommandLine parent) { | ||
this.parent = parent; | ||
} | ||
|
||
CommandLine parent; | ||
|
||
@CommandLine.Parameters (description = "The generated auto-complete script", defaultValue = "artemis-auto-complete.sh") | ||
File autoCompleteFile; | ||
|
||
@Override | ||
public void run() { | ||
try { | ||
AutoComplete.bash("artemis", autoCompleteFile, null, parent); | ||
System.out.println("Type the following commands before you can use auto-complete:"); | ||
System.out.println("*******************************************************************************************************************************"); | ||
System.out.println("source " + autoCompleteFile.getAbsolutePath()); | ||
System.out.println("*******************************************************************************************************************************"); | ||
|
||
} catch (Throwable e) { | ||
e.printStackTrace(); | ||
} | ||
} | ||
} |
Oops, something went wrong.