Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

help docs for commands#17

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
ShMcK merged 1 commit intomasterfromfix/create
Jun 1, 2020
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletionssrc/build.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -7,6 +7,7 @@ import { parse } from "./utils/parse";
import { getArg } from "./utils/args";
import { getCommits, CommitLogObject } from "./utils/commits";
import { validateSchema } from "./utils/validate";
import { build as help } from "./help";
import * as T from "../typings/tutorial";

const write = util.promisify(fs.writeFile);
Expand All@@ -27,6 +28,12 @@ type BuildArgs = {

async function build(args: string[]) {
let options: BuildArgs;

if (args.length && ["--help", "-h"].includes(args[0])) {
help();
return;
}

try {
// default .
const dir = args[0].match(/^-/) ? "." : args[0];
Expand Down
6 changes: 6 additions & 0 deletionssrc/create.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -2,6 +2,7 @@ import ncp from "ncp";
import * as path from "path";
import { promisify } from "util";
import { getArg } from "./utils/args";
import { create as help } from "./help";

const copy = promisify(ncp);

Expand All@@ -14,6 +15,11 @@ type CreateArgs = {
async function create(args: string[]): Promise<void> {
let options: CreateArgs;

if (args.length && ["--help", "-h"].includes(args[0])) {
help();
return;
}

// default .
const dir = !args.length || args[0].match(/^-/) ? "." : args[0];
const lang = getArg(args, { name: "lang", alias: "l" }) || "js";
Expand Down
35 changes: 31 additions & 4 deletionssrc/help.ts
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -3,11 +3,38 @@ export default function help() {
Usage: coderoad [options]

Options:
help display these help docs
version show coderoad cli version
create start a new tutorial from a template
build generate a coderoad.json file from markdown and yaml
--help(-h) display these help docs
--version(-v) show coderoad cli version
create start a new tutorial from a template
build generate a coderoad.json file from markdown and yaml

More docs at https://github.com/coderoad/coderoad-cli
`);
}

export function create() {
console.log(`
Usage: coderoad create [path] [options]

Options:
--help (-h) display these help docs
--lang (-l) programming language for template
--testRunner (-t) test runner module for template

More docs at https://github.com/coderoad/coderoad-cli
`);
}

export function build() {
console.log(`
Usage: coderoad build [path] [options]

Options:
--help (-h) display these help docs
--markdown (-m) custom path to the tutorial markdown file (TUTORIAL.md)
--yaml (-y) custom path to the tutorial yaml file (coderoad.yaml)
--output (-o) custom path to tutorial json config file (coderoad.json)

More docs at https://github.com/coderoad/coderoad-cli
`);
}

[8]ページ先頭

©2009-2025 Movatter.jp