Skip to content

Commit f8e152c

Browse files
committed
update changelog for v0.2.0 and enable cli versioning
1 parent b661c69 commit f8e152c

3 files changed

Lines changed: 47 additions & 3 deletions

File tree

CHANGELOG.md

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,26 @@ All notable changes to this project will be documented in this file.
44

55
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/).
66

7+
8+
## [0.2.0] - 2025-12-31
9+
10+
### Added
11+
- Go-based `local-data` CLI replacing the legacy Bash implementation
12+
- Profile-based configuration with typed, programmatic config generation
13+
- Homebrew distribution support (`brew install danieljhkim/tap/local-data`)
14+
15+
### Notes
16+
- macOS only
17+
- Single-node (pseudo-distributed) local environment
18+
719
## [0.1.0] - 2025-12-20
820

9-
First public release.
21+
### First public release.
22+
23+
### Added
24+
- Bash-based `local-data` CLI
25+
- Profile-based configuration with hand-edited XML files
26+
- Wrapper commands for HDFS, Hive, YARN, and Spark
27+
- Service lifecycle management with PID tracking and logs
28+
29+

cmd/local-data/main.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,11 @@ import (
66
"github.com/danieljhkim/local-data-platform/internal/cli"
77
)
88

9+
var version = "dev"
10+
911
func main() {
12+
cli.SetVersion(version)
13+
1014
if err := cli.Execute(); err != nil {
1115
os.Exit(1)
1216
}

internal/cli/root.go

Lines changed: 22 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
package cli
22

33
import (
4+
"fmt"
45
"os"
56
"path/filepath"
67

@@ -19,8 +20,9 @@ var (
1920

2021
// rootCmd represents the base command when called without any subcommands
2122
var rootCmd = &cobra.Command{
22-
Use: "local-data",
23-
Short: "Manage a local Hadoop (HDFS + YARN) + Hive stack",
23+
Use: "local-data",
24+
Version: "dev",
25+
Short: "Manage a local Hadoop (HDFS + YARN) + Hive stack",
2426
Long: `local-data: manage a local Hadoop (HDFS + YARN) + Hive stack.
2527
2628
A modular CLI to manage HDFS/YARN/Hive/Spark in one place with runtime
@@ -30,6 +32,14 @@ config overlays and profile-based configuration.`,
3032
// Run: func(cmd *cobra.Command, args []string) { },
3133
}
3234

35+
func SetVersion(v string) {
36+
if v == "" {
37+
return
38+
}
39+
rootCmd.Version = v
40+
rootCmd.SetVersionTemplate("{{.Version}}\n")
41+
}
42+
3343
// Execute adds all child commands to the root command and sets flags appropriately.
3444
// This is called by main.main(). It only needs to happen once to the rootCmd.
3545
func Execute() error {
@@ -47,6 +57,16 @@ func init() {
4757
rootCmd.AddCommand(service.NewStatusCmd(getPaths))
4858
rootCmd.AddCommand(NewLogsCmd(getPaths))
4959

60+
// Version command (explicit, for script-friendly `local-data version`)
61+
rootCmd.AddCommand(&cobra.Command{
62+
Use: "version",
63+
Short: "Print the local-data CLI version",
64+
Args: cobra.NoArgs,
65+
Run: func(cmd *cobra.Command, args []string) {
66+
fmt.Fprintln(os.Stdout, rootCmd.Version)
67+
},
68+
})
69+
5070
// Add wrapper commands
5171
rootCmd.AddCommand(wrappers.NewHDFSCmd(getPaths))
5272
rootCmd.AddCommand(wrappers.NewHiveCmd(getPaths))

0 commit comments

Comments
 (0)