Skip to content

Commit

Permalink
commands: flag - allow Host IDs as name prefixes
Browse files Browse the repository at this point in the history
  • Loading branch information
djdv committed Sep 13, 2023
1 parent c597010 commit c692c91
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions internal/commands/flag.go
Original file line number Diff line number Diff line change
Expand Up @@ -581,6 +581,12 @@ func parseMultiaddrList(parameter string) ([]multiaddr.Multiaddr, error) {
return maddrs, nil
}

func prefixIDFlag(system filesystem.ID) string {
return strings.ToLower(string(system)) + "-"
func prefixIDFlag[
T interface {
~string
filesystem.Host | filesystem.ID
},
](ID T,
) string {
return strings.ToLower(string(ID)) + "-"
}

0 comments on commit c692c91

Please sign in to comment.