-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
10 changed files
with
163 additions
and
73 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,16 @@ | ||
# Change Log | ||
|
||
## [Unreleased] | ||
## [0.2.0] - 2017-01-08 | ||
### Fixed | ||
- fix many bugs | ||
|
||
### Changed | ||
- gofmt-ed output | ||
|
||
### Added | ||
- support unix pipe input | ||
|
||
|
||
## [0.1.0] - 2017-01-06 | ||
### Added | ||
- pre-release |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
// Copyright 2017 aaharu All rights reserved. | ||
// This source code is licensed under the BSD-style license found in | ||
// the LICENSE file in the root directory of this source tree. | ||
|
||
// This source code use following software(s): | ||
// - go-jsschema https://github.com/lestrrat/go-jsschema | ||
// Copyright (c) 2016 lestrrat | ||
|
||
package cui | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"os" | ||
"path" | ||
"strings" | ||
) | ||
|
||
type Arguments struct { | ||
OutputFileName string | ||
PackageName string | ||
TypeName string | ||
ShowVersion bool | ||
} | ||
|
||
// Usage show help message. | ||
func Usage() { | ||
fmt.Fprint(os.Stderr, "SYNOPSIS\n") | ||
fmt.Fprint(os.Stderr, " schemarshal [options] [<json_schema_file>]\n") | ||
fmt.Fprint(os.Stderr, "OPTIONS\n") | ||
fmt.Fprint(os.Stderr, " -h, -help\n") | ||
fmt.Fprint(os.Stderr, " Show this help message.\n") | ||
fmt.Fprint(os.Stderr, " -o <file>, -output <file>\n") | ||
fmt.Fprintf(os.Stderr, " %s\n", flag.Lookup("o").Usage) | ||
fmt.Fprint(os.Stderr, " -p <package>, -package <package>\n") | ||
fmt.Fprintf(os.Stderr, " %s\n", flag.Lookup("p").Usage) | ||
fmt.Fprint(os.Stderr, " -t <package>, -type <package>\n") | ||
fmt.Fprintf(os.Stderr, " %s\n", flag.Lookup("t").Usage) | ||
fmt.Fprint(os.Stderr, " -v, -version\n") | ||
fmt.Fprintf(os.Stderr, " %s\n", flag.Lookup("v").Usage) | ||
} | ||
|
||
// ParseArguments parse command-line arguments | ||
func ParseArguments() *Arguments { | ||
args := new(Arguments) | ||
flag.Usage = Usage | ||
flag.StringVar(&args.OutputFileName, "o", "", "Write output to file instead of stdout.") | ||
flag.StringVar(&args.OutputFileName, "output", "", "Write output to file instead of stdout.") | ||
flag.StringVar(&args.PackageName, "p", "main", "Package name for output. (default `main`)") | ||
flag.StringVar(&args.PackageName, "package", "main", "Package name for output. (default `main`)") | ||
flag.StringVar(&args.TypeName, "t", "", "Set default Type name.") | ||
flag.StringVar(&args.TypeName, "type", "", "Set default Type name.") | ||
flag.BoolVar(&args.ShowVersion, "v", false, "Show version.") | ||
flag.BoolVar(&args.ShowVersion, "version", false, "Show version.") | ||
flag.Parse() | ||
return args | ||
} | ||
|
||
// FileName return file-name without ext | ||
func FileName(file *os.File) string { | ||
name := path.Base(file.Name()) | ||
ext := path.Ext(name) | ||
return strings.TrimRight(name, ext) | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,3 +1,6 @@ | ||
package: github.com/aaharu/schemarshal | ||
import: | ||
- package: github.com/lestrrat/go-jsschema | ||
- package: golang.org/x/crypto | ||
subpackages: | ||
- ssh/terminal |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -5,4 +5,4 @@ | |
package version | ||
|
||
// Version of schemarshal | ||
const Version = "0.1.0" | ||
const Version = "0.2.0" |
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