valise-sh 0.1.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -48,6 +48,13 @@ function sp_fish_metadata_validate_identifier_list --description 'Validate space
48
48
  sp_fish_metadata_error "invalid $label: $word"
49
49
  return 1
50
50
  end
51
+ if test "$label" = export
52
+ switch $word
53
+ case case do done elif else esac fi for if in then until while time
54
+ sp_fish_metadata_error "invalid export (reserved word): $word"
55
+ return 1
56
+ end
57
+ end
51
58
  end
52
59
  if test $seen -eq 0
53
60
  sp_fish_metadata_error "missing required metadata field: $label"
@@ -128,7 +135,7 @@ end
128
135
 
129
136
  function sp_fish_metadata_validate_side_effect --description 'Validate side_effect value'
130
137
  switch "$argv[1]"
131
- case read-only path-env generated-file update-network install-time local-secret work-only
138
+ case read-only path-env generated-file update-network install-time local-secret local-state work-only
132
139
  return 0
133
140
  case '*'
134
141
  sp_fish_metadata_error "invalid side_effect: $argv[1]"
@@ -186,7 +193,6 @@ function sp_fish_metadata_read --description 'Read and validate a .meta file, ou
186
193
  set -l m_updates ''
187
194
  set -l m_version ''
188
195
  set -l m_load ''
189
- set -l m_load_hook ''
190
196
 
191
197
  while read -l line
192
198
  # Skip empty lines and comments
@@ -211,7 +217,9 @@ function sp_fish_metadata_read --description 'Read and validate a .meta file, ou
211
217
  case updates; set m_updates $val
212
218
  case version; set m_version $val
213
219
  case load; set m_load $val
214
- case load_hook; set m_load_hook $val
220
+ case load_hook
221
+ sp_fish_metadata_error 'metadata field load_hook is not supported; use load'
222
+ return 1
215
223
  case '*'
216
224
  sp_fish_metadata_error "unknown metadata field: $key"
217
225
  return 1
@@ -239,16 +247,8 @@ function sp_fish_metadata_read --description 'Read and validate a .meta file, ou
239
247
  # Match the generic metadata ABI before the Fish loader applies its
240
248
  # shell/body selection. Generic POSIX records must parse successfully so
241
249
  # the loader can skip them when their shells do not include Fish.
242
- if test -z "$m_load"; and test -z "$m_load_hook"
243
- sp_fish_metadata_error 'missing required metadata field: load or load_hook'
244
- return 1
245
- end
246
- if test -n "$m_load"; and test -n "$m_load_hook"
247
- sp_fish_metadata_error 'metadata fields load and load_hook are mutually exclusive'
248
- return 1
249
- end
250
- if test -n "$m_load_hook"; and not sp_fish_metadata_validate_identifier "$m_load_hook"
251
- sp_fish_metadata_error "invalid load_hook: $m_load_hook"
250
+ if test -z "$m_load"; and test -z "$m_requires"
251
+ sp_fish_metadata_error 'missing required metadata field: load or requires'
252
252
  return 1
253
253
  end
254
254
 
@@ -295,6 +295,5 @@ function sp_fish_metadata_read --description 'Read and validate a .meta file, ou
295
295
  echo "updates=$m_updates"
296
296
  echo "version=$m_version"
297
297
  echo "load=$m_load"
298
- echo "load_hook=$m_load_hook"
299
298
  return 0
300
299
  end