Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit 24adb16

Browse files
committedJun 14, 2022
fix: codeflare cli should have a default guidebook
we should play ml/codeflare by default, if the user does not specify a guidebook to run.
1 parent 8d030dc commit 24adb16

File tree

3 files changed

+12
-7
lines changed

3 files changed

+12
-7
lines changed
 

‎bin/codeflare

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ do
118118
esac
119119
done
120120

121-
if [ $# = 1 ] && [ "$1" != "version" ]; then
121+
if [ $# = 0 ] || [ $# = 1 ] && [ "$1" != "version" ]; then
122122
# use the "guide" command if none was given
123123
EXTRAPREFIX="guide"
124124
fi

‎plugins/plugin-codeflare/src/plugin.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@
1414
* limitations under the License.
1515
*/
1616

17-
// import { Registrar } from '@kui-shell/core'
17+
import { Arguments, Registrar } from '@kui-shell/core'
18+
19+
function help() {
20+
return 'Usage: codeflare [run] [<task>] [-s /path/to/store] [-u]'
21+
}
1822

1923
/** Register Kui Commands */
20-
export default function registerCodeflareCommands(/* registrar: Registrar */) {
21-
/* e.g. this command will executable as "run"
22-
registrar.listen('/run', args => {
23-
})
24-
*/
24+
export default function registerCodeflareCommands(registrar: Registrar) {
25+
registrar.listen('/help', help)
2526
}

‎plugins/plugin-madwizard/src/plugin.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ function withFilepath(
2929
cb: (filepath: string, tab: Tab) => Promise<true | ReactResponse["react"]>
3030
) {
3131
return async ({ tab, argvNoOptions, parsedOptions }: Arguments<Options>) => {
32+
if (!argvNoOptions[1]) {
33+
argvNoOptions.push('ml/codeflare')
34+
}
35+
3236
if (!parsedOptions.u) {
3337
// CLI path
3438
const { cli } = await import("madwizard/dist/fe/cli/index.js")

0 commit comments

Comments
 (0)
Please sign in to comment.