Skip to content

Commit 5627d10

Browse files
committed
fix: fix hfe cmd usage
1 parent 302c205 commit 5627d10

2 files changed

Lines changed: 8 additions & 3 deletions

File tree

cli/action/dsk.go

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -160,7 +160,8 @@ type Action struct {
160160
}
161161

162162
func (a Action) DskIsSet() bool {
163-
return a.Path != ""
163+
hfeExists, _ := a.hfeIsSet()
164+
return a.Path != "" || hfeExists
164165
}
165166

166167
func (a *Action) WithOptions(options Options) *Action {
@@ -228,6 +229,7 @@ func (a *Action) SetDsk() (onError bool, message, hint string) {
228229
}
229230

230231
func (a *Action) DoDskActions() (onError bool, message, hint string) {
232+
var listAlreadyDone bool
231233
onError, message, hint = a.SetDsk()
232234
if onError {
233235
return onError, message, hint
@@ -260,10 +262,13 @@ func (a *Action) DoDskActions() (onError bool, message, hint string) {
260262
onError, message, hint = GetAllFileDsk(action.Folder, a.desc, a.options)
261263
case ActionListDsk:
262264
onError, message, hint = ListDsk(a.d, a.Path)
265+
listAlreadyDone = true
263266
case ActionFileinfoDsk:
264267
onError, message, hint = FileinfoDsk(a.d, a.fd.Path)
265268
default:
266-
onError, message, hint = ListDsk(a.d, a.Path)
269+
if !listAlreadyDone {
270+
onError, message, hint = ListDsk(a.d, a.Path)
271+
}
267272
}
268273
if onError {
269274
return onError, message, hint

cli/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ var (
5151
removeHeader = flag.Bool("removeheader", false, "Remove amsdos header from exported file")
5252
hfeFilepath = flag.String("hfe", "", "Path to the HFE file to handle.")
5353

54-
appVersion = "0.36"
54+
appVersion = "0.37"
5555
version = flag.Bool("version", false, "Display the application version and exit.")
5656
)
5757

0 commit comments

Comments
 (0)